home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
util
/
time
/
NISClock.lha
/
NISClock.doc
< prev
next >
Wrap
Text File
|
1998-02-04
|
14KB
|
303 lines
NISClock 2.20 (1998.Feb.21)
© Copyright 1995-97, 1998 John Muir
Written by John Muir
___________________________________________________________________________
Introduction
NISClock is a small clock program that displays the time and date
on the active public screen. Locale.library is used to format the
time and the date that you define. The text of your choosing (the
time by default) is displayed in a small window that matches the
screen's title-bar colour, or as a screen gadget button look-alike.
A mouse click on the window will display a second text (usually the
date).
The E-Clock timer is used to time the update intervals so that
the time is always updated even if the clock is adjusted backwards.
NISClock is written in C, and compiled with SAS/C 6.58.
Screen Notification
NISClock can make use of Stephan Becker's screennotify.library which
patches a few intuition.library functions so that the clock will
automatically close its window if the Public screen that it inhabits
is closed by another program. If NISClock is on the Workbench screen,
it will be notified of the close and opening of the Workbench screen
by IPrefs for a preferences change or by any other program which calls
CloseWorkbench(). The window will then not open until OpenWorkbench()
is called.
Other Options
Other options include window position, justification of the text within
the window, a specified amount of time (seconds) to update the clock
display, and the ability to avoid certain public screens.
___________________________________________________________________________
Requirements
NISClock has the following simple requirements:
- Amiga OS V37 (2.04). Uses V39 features if present.
- locale.library.
- RECOMMENDED: screennotify.library by Stephan Becker. See
'Installation' for more information on screennotify.library.
- NISClock must be run from the Workbench; perfect for the WBStartup
drawer.
___________________________________________________________________________
Installation
Use the Workbench to copy NISClock into the WBStartup drawer to have
the program execute as you startup. If you have a 68000, use the CLI
to delete NISClock, and rename NISClock_000 as NISClock before copying
it.
If you decide to use screennotify.library by Stephan Becker for the
enhanced features, the library must be installed in LIBS: or PROGDIR:
(the directory where NISClock is started from). Get
screennotify.library from the distribution archive on AmiNET:
/pub/aminet/util/libs/ScreenNotify10.lha (19K)
___________________________________________________________________________
Usage
Execution
To run NISClock, simply double-click on the icon! To run NISClock at
startup, place the program in the WBStartup drawer. NISClock can be
halted by executing the program again.
NISClock will not run from the CLI.
Date and Time Display
NISClock will by default display the text defined by TIMEFORMAT. The
text defined by DATEFORMAT can be displayed for four seconds by
clicking on the NISClock window.
If the time text or date text is too big for the current window size,
then the window is enlarged to fit the text. The window is never
shrunk back. The window will enlarge to the left if EDGE is negative,
or if the window does not fit any further right. Similarly, the
window will enlarge to the right if EDGE is positive, or the window
reaches the left edge of the screen.
Use the TOP and EDGE tooltypes to define the position of the NISClock
window. Use the JUST tooltype to justify the text within the NISClock
window.
Active Public Screen
NISClock will automatically jump to the active public screen. If
NISClock is using screennotify.library, then screen closures will
automatically be detected, and the window will be re-opened on the
active public screen.
Avoiding Public Screens
Screens can be avoided through the AVOIDSCR tooltype. That is,
NISClock will not open its window on screens that match the pattern
given with this tooltype. Custom screens (such as your screen blanker)
are automatically avoided. The Workbench screen cannot be avoided, so
you can keep the NISClock window on the Workbench screen with by
setting "AVOIDSCR=#?".
Tooltypes
Icon tooltypes are used to control the appearance of NISClock. NISClock
will automatically update itself if the icon tooltypes are changed.
NISClock accepts the following tooltypes:
UPDATE - Numeric; eg: UPDATE=1
- DEFAULT: UPDATE=60
- specifies the window update time in seconds.
- the E-Clock timer is used to time this period, with the
result that backward time changes do not affect the clock.
BUTTON - Boolean
- DEFAULT: FALSE
- if FALSE, the time is displayed in the title bar colours,
otherwise a box is drawn on the edge of the window to match the
screen gadget.
- NOTE: V37: Backpen = 2 (White) and FrontPen = 1 (Black).
EDGE - Numeric; eg: EDGE=400
- the value represents the edge of the NISClock window.
- DEFAULT: EDGE=-1
- if the value is negative, this is the right edge of the
window + 1, ie: EDGE=-1 signifies that the window is all the
way to the right of the screen, except that it must fit around
the screen gadget.
- the window cannot be positioned with the mouse, so make good
use of the file notificaiton on NISClock.info! :)
TOP - Numeric; eg: TOP=-4
- Top or bottom edge of the window.
- DEFAULT: TOP=0
- if the value is negative, this is the bottom edge of the
window + 1, ie: TOP=-1 signifies that the window is against
the bottom of the screen.
JUST - Enumerated
- display the time and/or date with justification;
JUST = CENTER, RIGHT, LEFT, or NONE.
- DEFAULT: JUST=NONE
- NONE means CENTER when BUTTON is true, and RIGHT otherwise.
TIMEFORMAT - Text; eg: TIMEFORMAT=Time: %H:%M:%S
- DEFAULT: TIMEFORMAT=%Q:%M %p
- specifies the format of the time text as defined by
the locale.library FormatDate() function.
- this is constructed just like C-language printf() statements,
except that different formatting codes are used. Just like in
C, formatting codes are a % followed by the formatting command.
The following commands are accepted by this function (from
AutoDocs):
%a - abbreviated weekday name
%A - weekday name
%b - abbreviated month name
%B - month name
%c - same as "%a %b %d %H:%M:%S %Y"
%C - same as "%a %b %e %T %Z %Y"
%d - day number with leading 0s
%D - same as "%m/%d/%y"
%e - day number with leading spaces
%h - abbreviated month name
%H - hour using 24-hour style with leading 0s
%I - hour using 12-hour style with leading 0s
%j - julian date
%m - month number with leading 0s
%M - the number of minutes with leading 0s
%n - insert a linefeed
%p - AM or PM strings
%q - hour using 24-hour style
%Q - hour using 12-hour style
%r - same as "%I:%M:%S %p"
%R - same as "%H:%M"
%S - number of seconds with leadings 0s
%t - insert a tab character
%T - same as "%H:%M:%S"
%U - week number, taking Sunday as first day of week
%w - weekday number
%W - week number, taking Monday as first day of week
%x -